clear all
set type double
do "graph_table_sub"	
global threshold_rd = .2
global threshold_fg = .02

**************************** Indonesia ****************************
use ../Data/Indonesia/xyz.dta, replace /* NAT==1only */
set seed 1002928
/* auctions in which the lowest bidder wins*/
cap drop temp

drop if z_konsultan == 1 

rename delta2 delta_win1 
rename delta2_p delta_win2  
rename delta delta_low1 
rename delta_p delta_low2  
rename delta3 delta_Nlow1
rename delta3_p delta_Nlow2


gen Eprocurement = (z_proc_type == "SEP")
bys z_state_name: egen Ep_state = max(Eprocurement)
gen non_EP = (Ep_state == 1 & Eprocurement == 0)

*Note:tabulation of N of auction by stata & year 　　  
tab z_state_name z_year if  winner == 1 


/* indonesia */
/* main*/
foreach d in "30" "60" "90" "120" "180" "365"{
	gen blogm`d' = blog`d' / 1000000
}


sum bid_date if z_final_rank == 1, detail
gen median_date = r(p50)
gen start_date = r(min)
gen end_date = r(max)
format start_date median_date end_date bid_date %td
gen sample_before = (bid_date <= median_date) 

tab Eprocurement if sample_before == 1  & z_final_rank == 1

gen sample_after = (bid_date > median_date) if bid_date !=.
tab Eprocurement if sample_after == 1 & z_final_rank == 1


sum z_bid bid_date if winner == 1, detail

/*Figure 1: Binned Scatter Plot for 30-Day and 60-Day Log Backlog: Public Works Auctions from Indonesia. */
drawgraph_1x2_days delta_low1 lnblog "" "indonesia" "" "local_linear_notable" "30 60"

/*Figure 2: Binned Scatter Plot for 90-Day and 120-Day Log Backlog: Public Works Auctions from Indonesia.*/
drawgraph_1x2_days delta_low1 lnblog "" "indonesia" "" "local_linear_notable" "90 120"

/*Figure OF.1: Binned Scatter Plot for Log Backlog: Paper based Auctions from Indonesia */
drawgraph_1x2_days delta_low1 lnblog "Eprocurement == 0" "indonesia" "Paper Based" "local_linear_notable" "30 60"
drawgraph_1x2_days delta_low1 lnblog "Eprocurement == 0" "indonesia" "Paper Based" "local_linear_notable" "90 120"

/*Figure 3: Binned Scatter Plot for 30-Day and 60-Day Log Backlog: E-Procurement Auctions from Indonesia. */
drawgraph_1x2_days delta_low1 lnblog "Eprocurement == 1" "indonesia" "E-Procurement" "local_linear_notable" "30 60"

/*Figure 4: Binned Scatter Plot for 90-Day and 120-Day Log Backlog: E-Procurement Auctions from Indonesia. */
drawgraph_1x2_days delta_low1 lnblog "Eprocurement == 1" "indonesia" "E-Procurement" "local_linear_notable" "90 120"

/*Figure OG.1: Binned Scatter Plot for Log Backlog for Marginal 2nd and 3rd Place Bidders: Indonesia */
drawgraph_1x2_days delta_low2 lnblog "" "indonesia" "Placebo" "local_linear_notable" "30 60"
drawgraph_1x2_days delta_low2 lnblog "" "indonesia" "" "local_linear_notable" "90 120"

/*Figure OG.2: Binned Scatter Plot for Log Backlog for Marginal 2nd and 3rd Place Bidders:Paper-based Auctions from Indonesia */
drawgraph_1x2_days delta_low2 lnblog "Eprocurement == 0" "indonesia" "Placebo (Paper-Based)" "local_linear_notable" "30 60"
drawgraph_1x2_days delta_low2 lnblog "Eprocurement == 0" "indonesia" "" "local_linear_notable" "90 120"

/*Figure OG.3: Binned Scatter Plot for Log Backlog for Marginal 2nd and 3rd Place Bidders:E-procurement Auctions from Indonesia */
drawgraph_1x2_days delta_low2 lnblog "Eprocurement == 1" "indonesia" "Placebo (E-Procurement)" "local_linear_notable" "30 60"
drawgraph_1x2_days delta_low2 lnblog "Eprocurement == 1" "indonesia" "" "local_linear_notable" "90 120"


/* lower bound of collusive auctions */
foreach d in "30" "60" "90" "120"{
	sum lnblog`d', d
	local max = r(max)
	local sd = r(sd)
	local k = `max'/ (_pi/2)
	di "`k'"
	gen stdone_lnblog`d' = (lnblog`d')/`k'
	gen sinone_lnblog`d' = sin(stdone_lnblog`d')
	forvalues  k = 3(1)7{
		gen std`k'_lnblog`d' = ((lnblog`d'))/(`k') *`sd'
		gen sin`k'_lnblog`d' = sin(std`k'_lnblog`d')
	}
}
sum sin*

scatter sinone_lnblog120 lnblog120 if lnblog120 > 0


/*Table 6: Lower Bound on the Proportion of Uncompetitive Auctions, Indonesia */ 
foreach condition in "" "Eprocu == 1"{
		set seed 108283210
		local outcomevar = "sinone_lnblog"
		local runningvar = "delta_low1"
		local TABLE_combined = "" /* to refresh the local macro containing graph names*/
		preserve
			local procurement_type = ustrregexra("`condition'", "[ =]","")
			**args outcomevar runningvar condition DAYS graph_i GRAPH TABLE buyer
			drawgraph_sub `outcomevar' `runningvar' "`condition'" ///
				"30 60 90 120" "0" "`GRAPH'" "`TABLE'" "`procurement_type'"
			foreach e in `r(TABLE)' {
				di "`e'"
				local TABLE_combined = "`TABLE_combined' `e'"
			}
		restore
		if "`condition'" == "" {
			esttab `TABLE_combined' using ../Output/Table6.tex, ///
			f replace cells(none) collabels(none) title("`runningvar'") nonumbers ///
			stats(tau_bc se_tau_rb pv_rb h_r /*b_l *kernel bwselect*/ N, fmt(/*%6.0g*/3 3 3 3 "%9.0fc" ) ///
			labels(`"\raisebox{-2.3mm}[0mm][0mm]{$\hat{\beta}$}"' `" "' `"\it{p-value}"' `"\it{h}"' `"Obs."') layout(@ (@) [@] @ @) star(tau_bc)) ///
			starlevels(* 0.10 ** 0.05 *** 0.01) mtitles("30 Days" "60 Days" "90 Days" "120 Days") ///
			prehead(&\multicolumn{4}{c}{All}  \\)
			local TABLE_combined = "" /* to refresh the local macro containing graph names*/
		}
		else{
			esttab `TABLE_combined' using ../Output/Table6.tex, ///
			f append cells(none) collabels(none) title("`runningvar'") nonumbers ///
			stats(tau_bc se_tau_rb pv_rb h_r /*b_l *kernel bwselect*/ N, fmt(/*%6.0g*/3 3 3 3 "%9.0fc" ) ///
			labels(`"\raisebox{-2.3mm}[0mm][0mm]{$\hat{\beta}$}"' `" "' `"\it{p-value}"' `"\it{h}"' `"Obs."') layout(@ (@) [@] @ @) star(tau_bc)) ///
			starlevels(* 0.10 ** 0.05 *** 0.01) mtitles("30 Days" "60 Days" "90 Days" "120 Days") ///
			prehead(\hline \\[-3mm]&\multicolumn{4}{c}{E-Procurement} \\)
		}
}

* if graph_i = 0, it generates the table only

cap program drop tables
program tables 
	args TABLE_combined_i main_placebo_i pre_posthead_i filename_i replace_i anything_else_i	
	esttab `TABLE_combined_i' using "`filename_i'" , ///
	f `replace_i' cells(none) collabels(none) title("`runningvar'") nonumbers ///
	stats(tau_bc se_tau_rb pv_rb h_r /*b_l *kernel bwselect*/ N, fmt(/*%6.0g*/3 3 3 3 "%9.0fc" ) ///
	labels(`"\raisebox{-2.3mm}[0mm][0mm]{$\hat{\beta}$}"' `" "' `"\it{p-value}"' `"\it{h}"' `"Obs."') layout(@ (@) [@] @ @) star(tau_bc)) ///
	starlevels(* 0.10 ** 0.05 *** 0.01) ///
	mtitles("30 Days" "60 Days" "90 Days" "120 Days") `pre_posthead_i' 
end	

*/Table 4: RD Estimates for Log Backlog: E-procurement and Paper-Based Auctions in Indonesia */	
*/Table 5: RD Estimates of Log Backlog for Marginal 2nd and 3rd Place Bidders: Indonesia */		
foreach main_placebo in "" "_Placebo"{
	local TABLE_combined = "" /* to refresh the local macro containing graph names*/
	local runningvar = "delta_low1"
	if "`main_placebo'" == "_Placebo"{
		local runningvar = "delta_low2"	
	}
	foreach condition in "" "Eprocu == 1" "Eprocu == 0" /*"limited == 1"*/ {
		set seed 108283210
		local outcomevar = "lnblog"
		preserve
			local procurement_type = ustrregexra("`condition'", "[ =]","")
			**args outcomevar runningvar condition DAYS graph_i GRAPH TABLE buyer
			 qui drawgraph_sub `outcomevar' `runningvar' "`condition'" ///
				"30 60 90 120" "0" "`GRAPH'" "`TABLE'" "`procurement_type'"
			foreach e in `r(TABLE)' {
				local TABLE_combined = "`TABLE_combined' `e'"
			}
		restore
		if  "`condition'" == "" & "`main_placebo'" == ""{
			*tables "`TABLE_combined'" "`main_placebo'" "" "Output/Table3.tex" "replace" ""
		}
		else if "`condition'" == "" & "`main_placebo'" == "_Placebo"{
			tables "`TABLE_combined'" "`main_placebo'" "" "../Output/Table5.tex" "replace" ""
		} 
		else if "`condition'" == "Eprocu == 1" {
			if "`main_placebo'" == ""{
				*
				tables "`TABLE_combined'" "`main_placebo'" "prehead(&\multicolumn{4}{c}{E-Procurement}\\)" ///
					"../Output/Table4.tex" "replace" ""
			}
			else{
				tables "`TABLE_combined'" "`main_placebo'" "prehead(\hline\\[-3mm]&\multicolumn{4}{c}{E-Procurement}\\)" ///
					"../Output/Table5.tex" "append" ""
			}
		}
		else if "`condition'" == "Eprocu == 0" {
			if "`main_placebo'" == ""{
				
				tables "`TABLE_combined'" "`main_placebo'" "prehead(\hline\\[-3mm]&\multicolumn{4}{c}{Paper Based}\\)" ///
				"../Output/Table4.tex" "append" ""
			}
			else{
			tables "`TABLE_combined'" "`main_placebo'" "prehead(\hline\\[-3mm]&\multicolumn{4}{c}{Paper Based}\\)" ///
				"../Output/Table5.tex" "append" ""			    
			}
		}
		local TABLE_combined = "" /* to refresh the local macro containing graph names*/
	}
}

/*Table OD.1: RD Estimates of Backlog in Levels: Indonesia */ 
foreach main_placebo in "" /*"_Placebo" */ {
	local TABLE_combined = "" /* to refresh the local macro containing graph names*/
	local runningvar = "delta_low1"
	foreach outcomevar in /*"cum_win"*/ "blog" {
		
		if "`main_placebo'" == "_Placebo"{
			local runningvar = "delta_low2"	
		}
		foreach condition in "" "Eprocu == 1" "Eprocu == 0" /*"limited == 1"*/ {
			set seed 108283210
			preserve
				local procurement_type = ustrregexra("`condition'", "[ =]","")
				**args outcomevar runningvar condition DAYS graph_i GRAPH TABLE buyer
				qui drawgraph_sub `outcomevar' `runningvar' "`condition'" ///
					"30 60 90 120" "0" "`GRAPH'" "`TABLE'" "`procurement_type'"
				foreach e in `r(TABLE)' {
					local TABLE_combined = "`TABLE_combined' `e'"
				}
			restore
			if "`condition'" == "" & "`main_placebo'" == ""{
				tables "`TABLE_combined'" "`main_placebo'" "" "../Output/TableOD1.tex" "replace" ""
			}
			else if "`condition'" == "" & "`main_placebo'" == "_Placebo"{
				/*tables "`TABLE_combined'" "`main_placebo'" "" "../Output/tables/indonesia/Indonesia_rdtable_all_`outcomevar'`main_placebo'.tex" "replace" ""*/ 
			} 
			else if "`condition'" == "Eprocu == 1" {
				if "`main_placebo'" == ""{
					tables "`TABLE_combined'" "`main_placebo'" "prehead(\hline\\[-3mm]&\multicolumn{4}{c}{E-Procurement}\\)" ///
						"../Output/TableOD1.tex" "append" ""
				}
				else{
					*/tables "`TABLE_combined'" "`main_placebo'" "prehead(\hline\\[-3mm]&\multicolumn{4}{c}{E-Procurement}\\)" ///
						"../Output/tables/indonesia/Indonesia_rdtable_all_`outcomevar'`main_placebo'.tex" "append" "" */ 
				}
			}
		
			else if "`condition'" == "Eprocu == 0" {
				if "`main_placebo'" == ""{
					tables "`TABLE_combined'" "`main_placebo'" "prehead(\hline\\[-3mm]&\multicolumn{4}{c}{Paper Based}\\)" ///
						"../Output/TableOD1.tex" "append" ""
				}
				else{
				*/tables "`TABLE_combined'" "`main_placebo'" "prehead(\hline\\[-3mm]&\multicolumn{4}{c}{Paper Based}\\)" ///
						"../Output/tables/indonesia/Indonesia_rdtable_all_`outcomevar'`main_placebo'.tex" "append" ""    */
				}
			}
			local TABLE_combined = "" /* to refresh the local macro containing graph names*/
		}
	}
}

*Table OH.1: RD Estimates for Log Backlog: First Half and Second Half, Indonesia
foreach main_placebo in "" /* "_Placebo" */ {
	local TABLE_combined = "" /* to refresh the local macro containing graph names*/
	local runningvar = "delta_low1"
	if "`main_placebo'" == "_Placebo"{
		local runningvar = "delta_low2"	
	}
	foreach condition in "sample_before == 1" "sample_after == 1"{
		set seed 108283210
		local outcomevar = "lnblog"
		preserve
			local procurement_type = ustrregexra("`condition'", "[ =]","")
			**args outcomevar runningvar condition DAYS graph_i GRAPH TABLE buyer
			drawgraph_sub `outcomevar' `runningvar' "`condition'" ///
				"30 60 90 120" "0" "`GRAPH'" "`TABLE'" "`procurement_type'"
			foreach e in `r(TABLE)' {
				local TABLE_combined = "`TABLE_combined' `e'"
			}
		restore
		if "`condition'" == "sample_before == 1" {	/*add June 27, 2022*/
			tables "`TABLE_combined'" "`main_placebo'" "prehead(&\multicolumn{4}{c}{First Half})" "../Output/TableOH1.tex" "replace" ""
		}
		else if "`condition'" == "sample_after == 1" & "`main_placebo'" == ""{
			tables "`TABLE_combined'" "`main_placebo'" "prehead(&\multicolumn{4}{c}{Second Half})" "../Output/TableOH1.tex" "append" ""
		}
		local TABLE_combined = "" /* to refresh the local macro containing graph names*/
	}
}


/* Poisson  estimation */
/*
foreach condition in "" "Eprocu == 0" "Eprocu == 1" {
	local outcomevar = "lnblog"
	local runningvar = "delta_low1"
		
	cap drop `runningvar'_*  
	g `runningvar'_2 = `runningvar'^2 
	g `runningvar'_3 = `runningvar'^3 
	g `runningvar'_4 = `runningvar'^4
	g `runningvar'_pos = (`runningvar' > 0) 
	local cov "`runningvar' `runningvar'_2 `runningvar'_3 `runningvar'_4 `runningvar'_pos"
	
	if "`condition'" == ""{
		cap drop flag_tmp
		gen flag_tmp = 0
		sum `runningvar' if `runningvar' < 0, d
		replace flag_tmp = 1 if `runningvar' < `r(p10)'
		sum `runningvar' if `runningvar' > 0, d
		replace flag_tmp = 1 if `runningvar' > `r(p90)'
		
		poisson `outcomevar'30   `cov' if `runningvar' != 0 & flag_tmp == 0, vce(cluster contract_id) 
		est sto model1	
		poisson `outcomevar'60   `cov' if `runningvar' != 0 & flag_tmp == 0, vce(cluster contract_id)
		est sto model2	
		poisson `outcomevar'90   `cov' if `runningvar' != 0 & flag_tmp == 0, vce(cluster contract_id)
		est sto model3	
		poisson `outcomevar'120  `cov' if `runningvar' != 0 & flag_tmp == 0, vce(cluster contract_id)
		est sto model4	
		
		esttab model1 model2 model3 model4 using ../Output/poisson_result_Indonesia.tex,  ///
		f replace cells(b(fmt(3) star) se(fmt(3) par)) starlevels(* 0.10 ** 0.05 *** 0.01) collabels(none) ///
		keep(delta_low1_pos delta_low1 delta_low1_2 delta_low1_3 delta_low1_4 ) ///
		order(delta_low1_pos delta_low1 delta_low1_2 delta_low1_3 delta_low1_4) ///
		varlabels(delta_low1_pos "\raisebox{-2.3mm}[0mm][0mm]{$\hat{\beta}$}" delta_low1 "{$\hat{\beta_1}$}" delta_low1_2 "{$\hat{\beta_2}$}" delta_low1_3 "{$\hat{\beta_3}$}" delta_low1_4 "{$\hat{\beta_4}$}") ///
		prehead(&\multicolumn{4}{c}{All}) mtitles("30 Days" "60 Days" "90 Days" "120 Days")  stats(N, fmt(0) labels("Obs.")) 	
	}
	if "`condition'" == "Eprocu == 0"{
		cap drop flag_tmp
		gen flag_tmp = 0
		sum `runningvar' if `runningvar' < 0 & `condition', d
		replace flag_tmp = 1 if `runningvar' < `r(p10)'
		sum `runningvar' if `runningvar' > 0 & `condition', d
		replace flag_tmp = 1 if `runningvar' > `r(p90)'
		
		poisson `outcomevar'30   `cov' if `runningvar' != 0 & flag_tmp == 0 & `condition', vce(cluster contract_id) 
		est sto model1	
		poisson `outcomevar'60   `cov' if `runningvar' != 0 & flag_tmp == 0 & `condition', vce(cluster contract_id)
		est sto model2	
		poisson `outcomevar'90   `cov' if `runningvar' != 0 & flag_tmp == 0 & `condition', vce(cluster contract_id)
		est sto model3	
		poisson `outcomevar'120  `cov' if `runningvar' != 0 & flag_tmp == 0 & `condition', vce(cluster contract_id)
		est sto model4	
		
		esttab model1 model2 model3 model4 using ../Output/poisson_result_Indonesia.tex,  ///
		f append cells(b(fmt(3) star) se(fmt(3) par)) starlevels(* 0.10 ** 0.05 *** 0.01) collabels(none) ///
		keep(delta_low1_pos delta_low1 delta_low1_2 delta_low1_3 delta_low1_4 ) ///
		order(delta_low1_pos delta_low1 delta_low1_2 delta_low1_3 delta_low1_4) ///
		varlabels(delta_low1_pos "\raisebox{-2.3mm}[0mm][0mm]{$\hat{\beta}$}" delta_low1 "{$\hat{\beta_1}$}" delta_low1_2 "{$\hat{\beta_2}$}" delta_low1_3 "{$\hat{\beta_3}$}" delta_low1_4 "{$\hat{\beta_4}$}") ///
		prehead(&\multicolumn{4}{c}{Paper-Based}) mtitles("30 Days" "60 Days" "90 Days" "120 Days")  stats(N, fmt(0) labels("Obs.")) 	
	}
	if "`condition'" == "Eprocu == 1"{
		cap drop flag_tmp
		gen flag_tmp = 0
		sum `runningvar' if `runningvar' < 0 & `condition', d
		replace flag_tmp = 1 if `runningvar' < `r(p10)'
		sum `runningvar' if `runningvar' > 0 & `condition', d
		replace flag_tmp = 1 if `runningvar' > `r(p90)'
		
		poisson `outcomevar'30   `cov' if `runningvar' != 0 & flag_tmp == 0 & `condition', vce(cluster contract_id) 
		est sto model1	
		poisson `outcomevar'60   `cov' if `runningvar' != 0 & flag_tmp == 0 & `condition', vce(cluster contract_id)
		est sto model2	
		poisson `outcomevar'90   `cov' if `runningvar' != 0 & flag_tmp == 0 & `condition', vce(cluster contract_id)
		est sto model3	
		poisson `outcomevar'120  `cov' if `runningvar' != 0 & flag_tmp == 0 & `condition', vce(cluster contract_id)
		est sto model4	
		
		esttab model1 model2 model3 model4 using ../Output/poisson_result_Indonesia.tex,  ///
		f append cells(b(fmt(3) star) se(fmt(3) par)) starlevels(* 0.10 ** 0.05 *** 0.01) collabels(none)  ///
		keep(delta_low1_pos delta_low1 delta_low1_2 delta_low1_3 delta_low1_4 ) ///
		order(delta_low1_pos delta_low1 delta_low1_2 delta_low1_3 delta_low1_4) ///
		varlabels(delta_low1_pos "\raisebox{-2.3mm}[0mm][0mm]{$\hat{\beta}$}" delta_low1 "{$\hat{\beta_1}$}" delta_low1_2 "{$\hat{\beta_2}$}" delta_low1_3 "{$\hat{\beta_3}$}" delta_low1_4 "{$\hat{\beta_4}$}") ///
		prehead(&\multicolumn{4}{c}{E-Procurement}) mtitles("30 Days" "60 Days" "90 Days" "120 Days") stats(N, fmt(0) labels("Obs.")) 	
	}	
}
*/

		
cap drop flag_tmp
	gen flag_tmp = 0
	sum delta_low1 if delta_low1 < 0, d	
	replace flag_tmp = 1 if delta_low1 < `r(p10)'
	sum delta_low1 if delta_low1 > 0, d
	replace flag_tmp = 1 if delta_low1 > `r(p90)'


/*Table OC.1: Fixed Effects Estimates for Log Future Award Amount: Indonesia - All Sample */ 
reghdfe lnflog30 winner if flag_tmp == 0 & delta_low1 != 0, absorb(firm_id) cluster(contract_id)
est sto model1
reghdfe lnflog60 winner if flag_tmp == 0 & delta_low1 != 0, absorb(firm_id) cluster(contract_id)
est sto model2
reghdfe lnflog90 winner if flag_tmp == 0 & delta_low1 != 0, absorb(firm_id) cluster(contract_id)
est sto model3
reghdfe lnflog120 winner if flag_tmp == 0 & delta_low1 != 0, absorb(firm_id) cluster(contract_id)
est sto model4

esttab model1 model2 model3 model4 using ../Output/TableOC1.tex,  ///
	f replace cells(b(fmt(3) star) se(fmt(3) par)) nonumbers /// 
	starlevels(* 0.10 ** 0.05 *** 0.01) /// 
	collabels(none) ///
	keep(winner) order(winner) varlabels(winner  "\raisebox{-2.3mm}[0mm][0mm]{$\hat{\beta}$}") ///
	prehead(&\multicolumn{4}{c}{All Sample}) /// 
	mtitles("30 Days" "60 Days" "90 Days" "120 Days") ///
	stats(N, fmt(0) labels("Obs."))

cap drop sample 
g sample = e(sample)

sum percent_final_bid if sample == 1, d 
g median = r(p50) if sample == 1 
cap drop temp 
g temp = (percent_final_bid <= median) if percent_final_bid !=. & sample == 1

tab temp  
qui bys contract_id: g N_participants = _N 
bys temp: sum N_participants, d 

bysort contract_id: egen sample_comp = max(temp) if sample == 1 

/*Table OC.1: Fixed Effects Estimates for Log Future Award Amount: Indonesia - Competitive Auction */ 
cap drop flag_tmp
	gen flag_tmp = 0 if sample_comp == 1
	sum delta_low1 if delta_low1 < 0 & sample_comp == 1, d	
	replace flag_tmp = 1 if delta_low1 < `r(p10)' & sample_comp == 1
	sum delta_low1 if delta_low1 > 0 & sample_comp == 1, d
	replace flag_tmp = 1 if delta_low1 > `r(p90)' & sample_comp == 1
	
reghdfe lnflog30 winner if flag_tmp == 0 & sample_comp == 1 & delta_low1 != 0 , absorb(firm_id) cluster(contract_id)
est sto model1
reghdfe lnflog60 winner if flag_tmp == 0 & sample_comp == 1 & delta_low1 != 0 , absorb(firm_id) cluster(contract_id)
est sto model2
reghdfe lnflog90 winner if flag_tmp == 0 & sample_comp == 1 & delta_low1 != 0 , absorb(firm_id) cluster(contract_id)
est sto model3
reghdfe lnflog120 winner if flag_tmp == 0 & sample_comp == 1 & delta_low1 != 0 , absorb(firm_id) cluster(contract_id)
est sto model4

esttab model1 model2 model3 model4 using ../Output/TableOC1.tex,  ///
	f append cells(b(fmt(3) star) se(fmt(3) par)) nonumbers /// 
	starlevels(* 0.10 ** 0.05 *** 0.01) /// 
	collabels(none) ///
	keep(winner) order(winner) varlabels(winner  "\raisebox{-2.3mm}[0mm][0mm]{$\hat{\beta}$}") ///
	prehead(&\multicolumn{4}{c}{Competitive Auctions}) /// 
	mtitles("30 Days" "60 Days" "90 Days" "120 Days") ///
	stats(N, fmt(0) labels("Obs."))

